using System;
using System.ComponentModel;

namespace LiveSequence.Common.Domain
{
    [Serializable]
    public class ObjectInstanceInfo : ICloneable
    {
        private const string TYPE_DEFINITION = "Type Definition";
        [Category(TYPE_DEFINITION)]
        [ReadOnly(true)]
        public string TypeName { get; set; }

        public string Key { get; set; }

        private bool _bVisible;

        public bool Visible
        {
            get { return _bVisible; }

            set { _bVisible = value; }
        }

        [Category(TYPE_DEFINITION)]
        [ReadOnly(true)]
        public string NameSpace { get; set; }

        public ObjectInstanceInfo()
        {
          
        }

        public ObjectInstanceInfo(string typeName, string key, string strNameSpace)
        {
            this.TypeName = typeName;
            this.Key = key;

            Visible = true;
            NameSpace = strNameSpace;
        }

        public override string ToString()
        {
            string sb = string.Format("ObjectInstanceInfo :: Adding TypeName: {0}, Key: {1}",
                                      this.TypeName, this.Key);
            return sb;
        }


        #region ICloneable Members

        public object Clone()
        {
          ObjectInstanceInfo objInstInfo = new ObjectInstanceInfo(this.TypeName, this.Key, this.NameSpace);
          objInstInfo.Visible = this.Visible;
          return objInstInfo;
        }

        #endregion
    }
}